export const systemInfo = {
  data: () => ({
    statusBarHeight: 0,
    navigationBarHeight: 0,
    navHeight: 0,
    windowHeight: 0, // 可使用窗口高度
  }),

  methods: {
    // 获取设备信息
    getSystemInfo() {
	  // let total = Number(navHeight + res.statusBarHeight) / (uni.upx2px(100) / 100);
	  // rpx内置转换 = xxx(px)/(uni.upx2px(100) / 100)
      let statusBarHeight = Number(getApp().globalData.statusBarHeight)/ (uni.upx2px(100) / 100)
	  this.statusBarHeight = Number(parseInt(statusBarHeight))
	  
      let navigationBarHeight = Number(getApp().globalData.navigationBarHeight)/ (uni.upx2px(100) / 100)
	  this.navigationBarHeight = Number(parseInt(navigationBarHeight))
	  
      this.windowHeight = uni.getSystemInfoSync().windowHeight
	  
      let navHeight = Number(getApp().globalData.navHeight)/ (uni.upx2px(100) / 100)
	  this.navHeight = Number(parseInt(navHeight))
    },
  },
}
